


var GROUPING_MAX = 3;



var CHART_TYPE_BAR = "Bar";
var CHART_TYPE_COLUMN = "Column";
var CHART_TYPE_LINE = "Line";
var CHART_TYPE_PIE = "Pie";

var DIRECTION_UP = 0;
var DIRECTION_DOWN = 1;
var DIRECTION_LEFT = 2;
var DIRECTION_RIGHT = 3;



var GROUP_INTERVAL_DAY = "Day";
var GROUP_INTERVAL_WEEK = "Week";
var GROUP_INTERVAL_MONTH = "Month";
var GROUP_INTERVAL_FISCALPERIOD = "FiscalPeriod";
var GROUP_INTERVAL_YEAR = "Year";



var SUMMARY_VALUE_AVG = "Avg";
var SUMMARY_VALUE_COUNT = "Count";
var SUMMARY_VALUE_MAX = "Max";
var SUMMARY_VALUE_MIN = "Min";
var SUMMARY_VALUE_PERCENT_TOTAL = "PercentTotal";
var SUMMARY_VALUE_SUM = "Sum";










function ConfirmWizardClose()
{
return confirm(LOCID_CANCEL_PROMPT);
}







function isNumericDataType(sDataType)
{
var bIsNumeric = false;
switch (sDataType)
{
case "decimal":
case "float":
case "int":
case "money":
bIsNumeric = true;
break
}

return bIsNumeric;
}






function getGroupIntervalArray()
{
var saGroupIntervals = new Array();
saGroupIntervals[GROUP_INTERVAL_DAY] = LOCID_GRP_INTERVAL_DAY_FMT;
saGroupIntervals[GROUP_INTERVAL_WEEK] = LOCID_GRP_INTERVAL_WEEK_FMT;
saGroupIntervals[GROUP_INTERVAL_MONTH] = LOCID_GRP_INTERVAL_MONTH_FMT;
saGroupIntervals[GROUP_INTERVAL_FISCALPERIOD] = LOCID_GRP_INTERVAL_FP_FMT;
saGroupIntervals[GROUP_INTERVAL_YEAR] = LOCID_GRP_INTERVAL_YEAR_FMT;
return saGroupIntervals;
}







function getSummaryPageUrl()
{

var oStringBuilder = new StringBuilder();



var oFetchBuilder = new FetchBuilder();
oFetchBuilder.LoadXml(WizardGetProperty("FetchXml"));


oStringBuilder.Append(prependOrgName("/CRMReports/AdHocWizard/SummaryPage.aspx"));


oStringBuilder.Append("?lcid=");
oStringBuilder.Append(CrmEncodeDecode.CrmUrlEncode(WizardGetProperty("Language")));


oStringBuilder.Append("&primary=");
oStringBuilder.Append(CrmEncodeDecode.CrmUrlEncode(oFetchBuilder.GetPrimaryEntityName()));


var sSecondaryEntity = oFetchBuilder.GetSecondaryEntityName();
if (!IsNull(sSecondaryEntity))
{
oStringBuilder.Append("&secondary=");
oStringBuilder.Append(CrmEncodeDecode.CrmUrlEncode(sSecondaryEntity));
}

return oStringBuilder.ToString();
}






function getSummaryValueArray()
{
var saSummaryValues = new Array();
saSummaryValues[SUMMARY_VALUE_AVG] = LOCID_SUMMARY_VALUE_AVG;
saSummaryValues[SUMMARY_VALUE_MAX] = LOCID_SUMMARY_VALUE_MAX;
saSummaryValues[SUMMARY_VALUE_MIN] = LOCID_SUMMARY_VALUE_MIN;
saSummaryValues[SUMMARY_VALUE_PERCENT_TOTAL] = LOCID_SUMMARY_VALUE_PCT;
saSummaryValues[SUMMARY_VALUE_SUM] = LOCID_SUMMARY_VALUE_SUM;
return saSummaryValues;
}
